#!/usr/bin/env bash

# Declare the associative array.
declare -A my_assoc_array
# Assign new keys and values to the associative array.
my_assoc_array[apple]="green"
my_assoc_array[banana]="yellow"
my_assoc_array[cherry]="red"
# The whole associative array is accessed as follows:
for key in "${!my_assoc_array[@]}"
do
  # A key/value pair is accessed as shown:
  echo "$key: ${my_assoc_array[$key]}"
done
